package practise.mulitThreads.ConcurrentInPractice.secondTime.CustomerizedCounter;

/**
 * Created by Richard on 7/28/2014.
 */
public class Counter {
    SimulatedCAS simulatedCAS = new SimulatedCAS();
    public Integer addAndGet(){
        while(!simulatedCAS.compareAndSet(simulatedCAS.get(),simulatedCAS.get()+1));
        return simulatedCAS.get();
    }
}
